/**
 * 
 */
package com.googolmo.NowPlaying;

import java.util.Date;

import android.app.Application;

/**
 * @author googolmo
 * 
 */
public class NowPlayingApplication extends Application {

	private static NowPlayingApplication instance;

	public static NowPlayingApplication getInstance() {
		return instance;
	}

	private Date lastPlayTime;
	private String lastPlayInfo;

	/**
	 * @return the lastPlayTime
	 */
	public Date getLastPlayTime() {
		if (lastPlayTime == null) {
			lastPlayTime = new Date(System.currentTimeMillis());
		}
		return lastPlayTime;
	}

	/**
	 * @param lastPlayTime
	 *            the lastPlayTime to set
	 */
	public void setLastPlayTime(Date lastPlayTime) {
		this.lastPlayTime = lastPlayTime;
	}

	/**
	 * @return the lastPlayInfo
	 */
	public String getLastPlayInfo() {
		if (lastPlayInfo == null) {
			lastPlayInfo = "";
		}
		return lastPlayInfo;
	}

	/**
	 * @param lastPlayInfo
	 *            the lastPlayInfo to set
	 */
	public void setLastPlayInfo(String lastPlayInfo) {
		this.lastPlayInfo = lastPlayInfo;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.app.Application#onCreate()
	 */
	@Override
	public void onCreate() {
		instance = this;
		this.lastPlayInfo = new String("");
		this.lastPlayTime = new Date(System.currentTimeMillis());
		super.onCreate();
	}

}
